-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: to_numeric downcast = 'unsigned' would not un-sign a 0 value. #14504
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@@ -78,3 +78,7 @@ Bug Fixes | |||
|
|||
|
|||
- Bug in ``pd.pivot_table`` may raise ``TypeError`` or ``ValueError`` when ``index`` or ``columns`` is not scalar and ``values`` is not specified (:issue:`14380`) | |||
- Bug in ``pd.pivot_table`` may raise ``TypeError`` or ``ValueError`` when ``index`` or ``columns`` | |||
- Bug in ``pd.to_numeric`` where a 0 was not unsigned on a downcast = 'unsigned' argument (:issue:`14401`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just add your fix, don't change the existing
can you rebase this |
Current coverage is 85.28% (diff: 100%)@@ master #14504 diff @@
==========================================
Files 140 140
Lines 50693 50693
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
Hits 43235 43235
Misses 7458 7458
Partials 0 0
|
@verhalenn There is still a test failing. Do you have time to look into this? |
045751f
to
855f4e5
Compare
@jorisvandenbossche I have been but I'm having trouble replicating it. |
@verhalenn Apparently this is a bug in older numpy versions:
So you can skip the failing test for numpy versions of 1.8 or lower. |
855f4e5
to
6ed6bde
Compare
That should do. If there is anything you would like different, let me know. Also thanks @jorisvandenbossche for the help. |
@verhalenn See here for an example how to skip a test for a numpy version:
Can you also move the whatsnew note to the 0.19.2 file ? |
ce5eb34
to
12a3dca
Compare
@@ -58,4 +58,4 @@ Bug Fixes | |||
- Bug in ``df.groupby`` causing an ``AttributeError`` when grouping a single index frame by a column and the index level (:issue`14327`) | |||
- Bug in ``df.groupby`` where ``TypeError`` raised when ``pd.Grouper(key=...)`` is passed in a list (:issue:`14334`) | |||
- Bug in ``pd.pivot_table`` may raise ``TypeError`` or ``ValueError`` when ``index`` or ``columns`` | |||
is not scalar and ``values`` is not specified (:issue:`14380`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
revert this file
@@ -25,3 +25,4 @@ Bug Fixes | |||
|
|||
- compat with ``dateutil==2.6.0`` for testing (:issue:`14621`) | |||
- allow ``nanoseconds`` in ``Timestamp.replace`` kwargs (:issue:`14621`) | |||
- Bug in ``pd.to_numeric`` where a 0 was not unsigned on a downcast = 'unsigned' argument (:issue:`14401`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
downcast='unsigned'
(use double-backticks)
@@ -4,9 +4,11 @@ | |||
import nose | |||
|
|||
import numpy as np | |||
from numpy import (iinfo, int8, int16, int32, int64, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't import these, just access np.iinfo
etc
('uint8', u, [iinfo(uint8).min, iinfo(uint8).max]), | ||
('uint16', u, [iinfo(uint16).min, iinfo(uint16).max]), | ||
('uint32', u, [iinfo(uint32).min, iinfo(uint32).max]), | ||
# ('uint64', u, [iinfo(uint64).min, iinfo(uint64).max]), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
put a comment on why skipping the uint64
I also added a series of other tests that included making sure that a dtype shifted dtype once it reached the next value and once again edited the whatsnew.
This reverts commit 636de09. Conflicts: doc/source/whatsnew/v0.19.1.txt
a978df4
to
07264cd
Compare
thanks! |
closes pandas-dev#14504 closes pandas-dev#14401 (cherry picked from commit b5864b0)
git diff upstream/master | flake8 --diff
Have to figure out whats going wrong with the build still. Will let you know as soon as I do.